package edu.cuny.baruch.cis9590.library.database;

import java.util.List;

import edu.cuny.baruch.cis9590.library.entities.Login;

public class LoginDAO extends LibraryDAO<Login> {
    
    @Override
    protected Class<Login> getEntityClass() {
        return Login.class;
    }
    
    public Login getLogin(String username) {
        List<Login> logins = query("from Login where username = '" + username + "'");
        if (logins.size() != 1) {
            return null;
        }
        return logins.get(0);
    }
}
